<template>
  <h3>ComponentA</h3>
  <p>{{ msg }}</p>
  <button @click="updateHandle">新数据</button>
</template>
<script>
export default {
  data() {
    return {
      msg: '老数据'
    }
  }
  , beforeUnmount() {
    console.log('被卸载之前');
  }
  , unmounted() {
    console.log('被卸载之后');
  }
  , methods: {
    updateHandle() {
      this.msg = 'x新数据'
    }
  }
}

</script>